package com.mypro.games;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mypro.common.base.BaseController;
import com.mypro.common.user.User;

@RequestMapping(value="/games")
@Controller
public class GamesController extends BaseController{
	
	private static Logger log = Logger.getLogger(GamesController.class);

	@RequestMapping(value="/xajh",method=RequestMethod.GET)
	public String toLoginPage(){
		return "games/xajh";
	}
	
	@RequestMapping(value="/jjsg",method=RequestMethod.GET)
	public String toLeftPage(){
		return "games/jjsg";
	}
	
	@RequestMapping(value="/jsonTest",method=RequestMethod.GET)
	@ResponseBody
	public List<User> jsonTest(HttpServletRequest request){
		List<User> list = new ArrayList<User>();
		User loginUser = (User)request.getSession().getAttribute("loginUser");
		list.add(loginUser);
		return list;
	}
	
	@RequestMapping(value="/stringTest",method=RequestMethod.GET)
	@ResponseBody
	public String stringTest(){
		return "stringTest";
	}
	
}
